from ronglian_sms_sdk import SmsSDK

accId = '8a216da878d42502017902fc98c31175'
accToken = 'dce45540713d48679788a6d07d1482c1'
appId = '8a216da878d42502017902fc99b3117c'

def send_message(mobile,sms_code):
    """
    mobile:手机号
    sms_code:短信
    time:过期时间
    """
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1' # 模板1,只能用这个
    mobile = mobile # 手机号码
    datas = (sms_code, 1) # 验证码内容,验证码有效时间
    resp = sdk.sendMessage(tid, mobile, datas)
    # 000000	请求成功
    # 172001	网络错误

    # print(resp)
"""
响应参数
{"statusCode":"000000",
"templateSMS":
    {"dateCreated":"20130201155306",
     "smsMessageSid":"ff8080813c373cab013c94b0f0512345"}
}
"""
# send_message(17835699470,123456,1)
